package com.ohs.ohsoa.system.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.github.pagehelper.PageInfo;
import com.ohs.ohsoa.system.dto.TopMeetingDto;
import com.ohs.ohsoa.system.service.TopMeetingService;
import com.ohs.ohsoa.system.vo.TopMeetingVo;
import com.ohs.ohsoa.utils.auth.UserLoginToken;
import com.ohs.ohsoa.utils.bean.requestBean.PageParam;
import com.ohs.ohsoa.utils.bean.responseBean.ResultBean;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(value = "Top会议查询", tags = "Top会议查询")
@RestController
@RequestMapping("/topMeeting")
public class TopMeetingController {
    @Resource
    private TopMeetingService service;

    /**
     * 获取会议列表信息
     *
     * @param pageParam 检索用参数
     * @return 实例对象
     * @author ccj
     * @since 2021年9月24日
     */
    @UserLoginToken
    @PostMapping(value = "/selectMeetingList")
    @ApiOperation(httpMethod = "POST", value = "获取会议列表信息")
    public ResultBean<PageInfo<TopMeetingVo>> SelectMeetingList(@RequestBody PageParam<TopMeetingDto> pageParam) {
        List<TopMeetingVo> meetingDtoList = service.selectMeetingList(pageParam);
        return ResultBean.success(new PageInfo<>(meetingDtoList));
    }

    /**
     * 获取详细信息
     *
     * @param topMeetingDto 会议详细信息数据
     * @return 实例对象
     * @author ccj
     * @since 2021年9月24日
     */
    @UserLoginToken
    @PostMapping(value = "/selectMeeting")
    @ApiOperation(httpMethod = "POST", value = "根据ID查询会议详细信息")
    public ResultBean<?> SelectMeeting(@RequestBody TopMeetingDto topMeetingDto) {
        return ResultBean.success(service.selectMeeting(topMeetingDto));
    }
}
